//
//  ViewController.m
//  GCD常用函数
//
//  Created by 李煜 on 2024/3/20.
//

#import "ViewController.h"
#import "XMOperation.h"
@interface ViewController ()

@end

@implementation ViewController

-(void)viewDidLoad {
   [super viewDidLoad];

   [self customOperation];

}
- (void)customOperation {
	//已经有了NSBlockOperation和NSInvocationOperation,为什么还要有自定义Operation?
	//1. 代码隐蔽
	//2. 代码复用
   XMOperation *op1 = [[XMOperation alloc]init];
   XMOperation *op2 = [[XMOperation alloc]init];

   NSOperationQueue *queue1  = [[NSOperationQueue alloc]init];
   NSOperationQueue *queue2  = [[NSOperationQueue alloc]init];


   [queue1 addOperation:op1];
   [queue2 addOperation:op2];
}
@end
